//
//  TableViewCell.swift
//  SLQuickReader
//
//  Created by ALin on 2017/8/3.
//  Copyright © 2017年 ALin. All rights reserved.
//

import UIKit
import Then
import SnapKit

let StatisticsCellHeight: CGFloat = 44.0

class StatisticsCell: UITableViewCell {
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupChildren()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate func setupChildren(){
        selectionStyle = .none
        backgroundColor = UIColor.clear
        
        addSubview(title)
        addSubview(tagsView)
        
        title.snp.makeConstraints {
            $0.top.equalTo(cellMargin)
            $0.height.equalTo(StatisticsCellHeight)
            $0.left.equalTo(0)
            $0.width.equalTo(self)
        }
        
        tagsView.snp.makeConstraints { (make) in
            make.top.equalTo(title.snp.bottom)
            make.width.equalTo(self)
            make.height.equalTo(StatisticsCellHeight)
            make.left.equalTo(0)
        }
        
    }
    
    lazy var title: UILabel = {
        let label = UILabel().then{
            $0.textColor = UIColor.black
            $0.font = UIFont.systemFont(ofSize: 15)
            $0.textAlignment = .center
            $0.backgroundColor = UIColor.white
        }
        return label
    }()
    
    lazy var tagsView: UIView = {
        let view = UIView().then{
            $0.backgroundColor = UIColor.white
        }
        return view
    }()
}
